import unittest
import warnings
from time import sleep

import user_data
from net_project_tools.XinPageLive import XinLivePage
from net_project_tools.net_live_page import NetLivePage


class XinLiveTest(unittest.TestCase):

    def setUp(self):
        warnings.simplefilter('ignore', ResourceWarning)

    def tearDown(self):
        self.page.logout()

    def test_net_live(self):
        """发布直播、开启直播"""
        self.page = XinLivePage()
        self.page.login(*user_data.Xinxi_project_admin)
        self.page.enter_project()
        self.page.enter_tools('直播')
        self.page.publish_live()
        sleep(10)
        self.page.start_live()


if __name__ == '__main__':
    unittest.main()